/*
 * WorldObjectFactory.java
 *
 * Created on 18. Mai 2007, 19:57
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package de.tor.obj.impl;

import com.golden.gamedev.engine.BaseIO;
import com.golden.gamedev.util.ImageUtil;
import de.tor.SpaceTiger;
import de.tor.loaders.Level;
import de.tor.obj.AbstractWorldObject;
import java.awt.Point;
import java.awt.Transparency;
import java.net.URL;

/**
 *
 * @author Charon
 */
public class WorldObjectFactory {
    
    public static final int STATION1 = 0;
    public static final int EXPLOSION1 = 1;
    
    private static Level mOwner = null;
    
    public static void init(Level pOwner){
        mOwner = pOwner;
    }
    
    public static AbstractWorldObject factorWorldObject(int pType){
        switch(pType){
            case STATION1:{
                BaseWorldObject wo = new BaseWorldObject(mOwner, mOwner.getImage("resources/levels/station1.png", true));
                wo.addExtensionPoint(new Point(89, 251));
                return wo;
            } case EXPLOSION1:{
                URL uTest = new BaseIO(SpaceTiger.class).getURL("resources/levels/explosion5.png");
                BaseWorldObject wo = new BaseWorldObject(mOwner, ImageUtil.getImages(uTest, 22,1,Transparency.TRANSLUCENT));
                
//wo.addExtensionPoint(new Point(89, 251));
                return wo;
            }default:{
                
            }
        }
        return null;
    }
}
